<template>
  <div id="codeModelSearch">
    <el-row :gutter="24">
      <el-col :span="4">
        <el-input v-model="params.name" placeholder="模型名称" /> 
      </el-col>
      <el-col :span="4">
        <el-input v-model="params.codeType" placeholder="代码标识" /> 
      </el-col>
      <el-col :span="4">
        <bms-select v-model="params.seqType" codeType="CODE_MODEL_TYPE_DICT" :placeholder="'模型类型'"></bms-select>
      </el-col>
      <el-col :span="4">
        <bms-select v-model="params.categories" codeType="CODE_MODEL_CATEGROIES_DICT" :placeholder="'分类'" ></bms-select>
      </el-col>
      <el-col :span="2">
        <el-button type="primary" round @click="selectCodeModelInfo">
          <i class="iconfont icon-sousuo size" />
          查询
        </el-button>
      </el-col>
      <el-col :span="2">
        <el-button type="primary" round @click="addCodeModel">
          <i class="iconfont icon-tianjia size" />
          新建
        </el-button>
      </el-col>
      <el-col :span="2">
        <el-button type="primary" round @click="exportCodeModel">
          <i class="iconfont icon-daochu size" />
          导出
        </el-button>
      </el-col>
    </el-row>

    <codeModelDialog ref="children" @refreshData="selectCodeModelInfo" />

  </div>
</template>

<script>
import BmsSelect from '@/components/quick/ui/bms-select.vue'
import {
  exportCodeModelInfo
} from '@/assets/request/api.js';
import codeModelDialog from './dialog.vue';
export default {
  components: { codeModelDialog,BmsSelect },
  name: 'codeModelSearch',
  data() {
    return {
      params: {
        name: '',
        codeType:'',
        seqType:'',
        categories:''
      },
    }
  },
  methods: {
    selectCodeModelInfo() {
      this.$emit("selectCodeModel",this.params)
    },
    addCodeModel() {
      this.$refs.children.receiveParent()
    },
    exportCodeModel() {
      exportCodeModelInfo(this.params).then(res => {

        this.$message({
          message: '导出成功',
          type: 'success'
        });

      }).catch(err => {
        this.$message({
          message: '导出失败',
          type: 'error'
        });
      })
    }
  },
 
    
}
</script>

<style scoped lang="scss">

.el-input /deep/ .el-input__inner{ 
  height: 32px;
  font-size: 13px;
  box-shadow: none;
  border: 1px solid #e9e9e9;
}

//对整个容器进行设置
.el-select /deep/ .el-input__inner {
  height: 32px;
}

.el-select /deep/ .el-input__suffix {
  .el-input__icon {
    line-height: 32px;
  }
}


.el-button {
  line-height: 0px;
  height: 32px;
  padding: 12px;
  border-radius: 20px;
  margin-left: 12px;
  .size {
    font-size: 4px;
  }
}

 
</style>
